<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2018/2/13
 * Time: 下午1:09
 */

$arr  = [ 1, 2, 3, 4 ];
$arr2 = [ 'a', 'b', 'c', 'd' ];
$arr3 = array_merge( $arr, $arr2 );
print_r( $arr3 );
$arr4 = $arr + $arr;
print_r( $arr4 );
echo $arr3 === $arr4;

$array1 = array( "color" => "red", 2, 4 );
$array2 = array( "a", "b", "color" => "green", "shape" => "trapezoid", 4 );
$result = array_merge( $array1, $array2 );
print_r( $result );

$data = [ [ 1, 2 ], [ 3 ], [ 4, 5 ] ];
print_r( array_merge( ... $data ) ); // [1, 2, 3, 4, 5];
print_r( array_merge( $data ) ); // [1, 2, 3, 4, 5];